<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">

      <el-form-item label="" prop="operateDeptName">
        <el-input v-model="queryParams.operateDeptName" placeholder="请输入科室名称" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>

      <el-form-item label="" prop="hosp">
        <el-select v-model="queryParams.hospitalCode" filterable placeholder="请选择医院">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>

      <!-- <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
          <el-option v-for="dict in dict.type.operate_dept_status" :key="dict.value" :label="dict.label"
            :value="dict.value" />
        </el-select>
      </el-form-item> -->

      <!-- <el-form-item label="疾病标签" prop="illnessLabel">
        <el-input v-model="queryParams.illnessLabel" placeholder="按疾病查" clearable @keyup.enter.native="handleQuery" />
      </el-form-item> -->

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['hcem:dept:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['hcem:dept:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['hcem:dept:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['hcem:dept:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="deptList" style="width:100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <!-- <el-table-column label="运营科室编码" align="center" prop="hospitalCode" /> -->
      <el-table-column label="医院名称" align="center" prop="hospitalName">
        <template slot-scope="scope">
          <span>{{ scope.row.hospitalName }}</span>
          <!-- <span>{{ HosLabel(scope.row.hospitalCode) }}</span> -->
        </template>
      </el-table-column>

      <el-table-column label="科室名称" align="center" prop="operateDeptName" />
      <el-table-column label="特色技术" align="center" prop="tsSkill" :show-overflow-tooltip="true"/>
      <el-table-column label="优势专病" align="center" prop="ysMajor" :show-overflow-tooltip="true"/>
      
      <!-- <el-table-column label="运营开始时间" align="center" prop="startTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="运营结束时间" align="center" prop="endTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column> -->
      <!-- <img :src="qrcode" alt="" width="60px" height="60px"> -->
      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
      <el-table-column label="科室码" align="center" prop="deptUrlCode">
        <template slot-scope="scope">
          <span @click="curQr(scope.row)">
            <img :src="qrcode" alt="" width="30px" height="30px"></span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.operate_dept_status" :value="scope.row.status" />
        </template>
      </el-table-column> -->

      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['hcem:dept:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['hcem:dept:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改运营科室管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
        <!-- 科室基础资料 -->
        <section class="section">科室基础资料</section>
        <el-form-item label="医院名称" prop="hospitalCode">
          <el-select v-model="form.hospitalCode" filterable placeholder="请选择医院" class="wp100">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
          <!-- <el-input v-model="form.hospitalName" placeholder="请输入医院名称" /> -->
        </el-form-item>
        <el-form-item label="科室名称" prop="operateDeptName">
          <el-input v-model="form.operateDeptName" placeholder="请输入科室名称" />
        </el-form-item>
        <el-form-item label="科室简介">
          <el-input v-model="form.detail" type="textarea" :placeholder="depInfo" />
          <!-- <editor v-model="form.detail" :min-height="192" /> -->
        </el-form-item>
        <el-form-item label="诊疗范围" prop="zlRange">
          <el-input v-model="form.zlRange" type="textarea" placeholder="包括诊疗疾病分类及每一类中的主要疾病名称" />
        </el-form-item>
        <el-form-item label="特色技术" prop="tsSkill">
          <el-input v-model="form.tsSkill" type="textarea" placeholder="如有层流病床等特色设施，或PICC等特色诊疗技术" />
        </el-form-item>
        <el-form-item label="优势专病" prop="ysMajor">
          <el-input v-model="form.ysMajor" type="textarea" placeholder="擅长治疗、在治疗方法或疗效上有特色优势的专病及其简介" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <!-- 没用到 -->
        <!-- <el-form-item label="擅长治疗疾病" prop="goodAt">
          <el-input v-model="form.goodAt" placeholder="请输入擅长治疗疾病" />
        </el-form-item>
        <el-form-item label="优势专业" prop="ysmajor">
          <el-input v-model="form.ysmajor" type="textarea" placeholder="请输入内容" />
        </el-form-item> -->
        <!-- 科室详细资料 -->
        <!-- <section class="section">科室详细资料</section> -->
        <!-- <div style="display: flex;">
          <el-form-item label="科室封面图" prop="coverImg">
            <el-upload class="upload-demo" drag action="#" :http-request="requestUpload" :show-file-list="false"
              :before-upload="depCover">
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
              <div class="el-upload__tip" slot="tip">支持jpg/jpeg/png格式，建议尺寸375*150，大小不超过5M</div>
            </el-upload>
          </el-form-item>
          <el-form-item label="诊室分布图" prop="distributeImg">
            <el-upload class="upload-demo" drag action="#" :http-request="requestUpload" :show-file-list="false"
              :before-upload="positionCover">
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
              <div class="el-upload__tip" slot="tip">上传多院区、诊室或病区分布图。支持jpg/jpeg/png格式，大小不超过5M</div>
            </el-upload>
          </el-form-item>
        </div> -->
        <!-- <el-form-item label="科室分布" prop="deptdistribute">
          <el-input v-model="form.deptdistribute" type="textarea" placeholder="请输入多院区、诊室或病区分布介绍" />
        </el-form-item> -->

        <!-- 科室标签 -->
        <!-- <section class="section">科室标签</section>
        <el-form-item label="重点科室" prop="keyDept">
          <el-select v-model="form.keyDept" filterable placeholder="请选择医院" class="wp100">
            <el-option v-for="item in dict.type.vip_dep" :key="item.value" :label="item.label" :value="item.label">
            </el-option>
          </el-select>
        </el-form-item> -->
        <!-- <el-form-item label="疾病标签" prop="illnessLabel">
          <div style="display: flex;align-items: center;">
            <el-input v-model="form.illnessLabel" placeholder="请输入疾病标签" />
            <el-button type="primary" style="margin-left: 30px;">添加</el-button>
          </div>
        </el-form-item> -->
        <!-- 科室运营设置 --tips-科室运营助理-->
        <!-- <section class="section">科室运营设置</section>
        <el-form-item label="姓名" prop="assistantName">
          <el-input v-model="form.assistantName" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="手机号" prop="assistantPhone">
          <el-input v-model="form.assistantPhone" placeholder="请输入手机号" />
        </el-form-item>
        <el-form-item label="职位" prop="assistantPost">
          <el-input v-model="form.assistantPost" placeholder="请输入职位" />
        </el-form-item>
        <el-form-item label="部门" prop="assistantDept">
          <el-input v-model="form.assistantDept" placeholder="请选择部门" />
        </el-form-item>
        <section class="section">平台运营专员：</section>
        <el-form-item label="专员名称" prop="attacheName">
          <el-input v-model="form.attacheName" placeholder="请输入专员名称" />
        </el-form-item>
        <el-form-item label="专员手机号" prop="attachePhone">
          <el-input v-model="form.attachePhone" placeholder="请输入专员手机号" />
        </el-form-item> -->


        <!-- 运营期限 -->
        <!-- <div style="display: flex;">
          <el-form-item label="专员服务时间" prop="attacheServiceTime">
            <el-date-picker clearable v-model="form.attacheServiceTime" type="date" value-format="yyyy-MM-dd"
              placeholder="请选择专员服务时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="运营开始时间" prop="startTime">
            <el-date-picker clearable v-model="form.startTime" type="date" value-format="yyyy-MM-dd"
              placeholder="请选择运营开始时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="运营结束时间" prop="endTime">
            <el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd"
              placeholder="请选择运营结束时间">
            </el-date-picker>
          </el-form-item>
        </div>
        <el-form-item label="运营状态" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio v-for="dict in dict.type.operate_dept_status" :key="dict.value" :label="parseInt(dict.value)">{{
              dict.label }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="科室工号" prop="deptNo">
          <el-input v-model="form.deptNo" placeholder="请输入科室工号" />
        </el-form-item>
        <el-form-item label="相关分类码" prop="deptCode">
          <el-input v-model="form.deptCode" placeholder="请输入相关分类码" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item> -->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :visible.sync="qrDialogVisible" width="50%" :before-close="closeDiago">
      <div class="dialog-img">
        <img :src="currentBase64" alt="" width="300px" height="300px">
      </div>
      <div class="dialog-footer">
        <el-button type="primary" @click="downloadImage">下载科室二维码</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listDept, getDept, delDept, addDept, updateDept, hospInfoPut } from "@/api/hcem/dept";
import { hosList } from '@/api/hcem/title'
export default {
  name: "Dept",
  dicts: ['operate_dept_status', 'vip_dep'],
  data() {
    return {
      qrDialogVisible: false,  //二维码弹窗
      currentBase64: '',  //当前科室二维码
      qrcode: require('@/assets/images/qrcode.png'),
      upLoadUrl: process.env.VUE_APP_BASE_API + '/hcem/dept/client/edit',//上传文件地址
      depInfo: '包括重点专科，诊疗中心，诊室数、床位数、病区数、政府颁奖及荣耀、协会组织成员等标签',
      options: [],//医院列表选项
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 运营科室管理表格数据
      deptList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        hospitalCode: null,
        operateDeptName: null,
        deptCode: null,
        startTime: null,
        endTime: null,
        detail: null,
        advantage: null,
        assistantName: null,
        assistantPhone: null,
        deptNo: null,
        remark: null,
        goodAt: null,
        status: null,
        attacheServiceTime: null,
        zlRange: null,
        tsSkill: null,
        ysmajor: null,
        coverImg: null,
        deptdistribute: null,
        distributeImg: null,
        keyDept: null,
        attacheName: null,
        attachePhone: null,
        assistantDept: null,
        assistantPost: null,
        illnessLabel: null,
        hospitalName: '',
        deptUrlCode: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        hospitalName: [
          { required: false, message: "医院名称不能为空", trigger: "blur" }
        ],
        hospitalCode: [
          { required: true, message: "医院名称不能为空", trigger: "blur" }
        ],
        operateDeptName: [
          { required: true, message: "运营科室名称不能为空", trigger: "blur" }
        ],
        deptCode: [
          { required: false, message: "相关分类码不能为空", trigger: "blur" }
        ],
        startTime: [
          { required: false, message: "运营开始时间不能为空", trigger: "blur" }
        ],
        endTime: [
          { required: false, message: "运营结束时间不能为空", trigger: "blur" }
        ],
        detail: [
          { required: false, message: "简介不能为空", trigger: "blur" }
        ],
        advantage: [
          { required: false, message: "优势/特色不能为空", trigger: "blur" }
        ],
        assistantName: [
          { required: false, message: "科室运营助理姓名不能为空", trigger: "blur" }
        ],
        assistantPhone: [
          { required: false, message: "科室运营助理手机号不能为空", trigger: "blur" }
        ],
        deptNo: [
          { required: false, message: "科室工号不能为空", trigger: "blur" }
        ],
        remark: [
          { required: false, message: "备注不能为空", trigger: "blur" }
        ],
        goodAt: [
          { required: false, message: "擅长治疗疾病不能为空", trigger: "blur" }
        ],
        status: [
          { required: false, message: "状态不能为空", trigger: "change" }
        ],
        createTime: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        updateTime: [
          { required: true, message: "更新时间不能为空", trigger: "blur" }
        ],
        attacheServiceTime: [
          { required: false, message: "平台专员服务时间不能为空", trigger: "blur" }
        ],
        zlRange: [
          { required: false, message: "治疗范围不能为空", trigger: "blur" }
        ],
        tsSkill: [
          { required: false, message: "特色技能不能为空", trigger: "blur" }
        ],
        ysmajor: [
          { required: false, message: "优势专病不能为空", trigger: "blur" }
        ],
        coverImg: [
          { required: false, message: "科室封面图不能为空", trigger: "blur" }
        ],
        deptdistribute: [
          { required: false, message: "科室分布不能为空", trigger: "blur" }
        ],

        distributeImg: [
          { required: false, message: "科室分布图不能为空", trigger: "blur" }
        ],
        keyDept: [
          { required: false, message: "重点科室不能为空", trigger: "blur" }
        ],

        attacheName: [
          { required: false, message: "平台专员名称不能为空", trigger: "blur" }
        ],

        attachePhone: [
          { required: false, message: "平台专员手机号不能为空", trigger: "blur" }
        ],
        assistantDept: [
          { required: false, message: "运营助理部门不能为空", trigger: "blur" }
        ],
        assistantPost: [
          { required: false, message: "运营助理职位不能为空", trigger: "blur" }
        ],
        illnessLabel: [
          { required: false, message: "疾病标签不能为空", trigger: "blur" }
        ]
      }
    };
  },
  computed: {
    //label: "医院名称",
    HosLabel(value) {
      return (value) => {
        if (this.options.length > 0 && value !== null) {
          for (var i in this.options) {
            if (this.options[i].value == value) {
              return this.options[i].label
            } else {
              return ""
            }

          }
        } else {
          return "暂无医院名称"
        }
      }
    }
  },
  async created() {
    await this.getHosList()
    await this.getList();
  },
  methods: {
    curQr(row) { //
      this.currentBase64 = 'data:image/png;base64,' + row.deptUrlCode
      this.qrDialogVisible = true
      //  console.log(this.currentBase64, 'rows');
    },
    closeDiago(done) {
      this.qrDialogVisible = false
      setTimeout(() => {
        this.currentBase64 = ''
      }, 200);
      //console.log(done, 'done');
    },
    generateRandomString(length) {
      const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
      let result = '';
      const charactersLength = characters.length;
      for (let i = 0; i < length; i++) {
        result += characters.charAt(Math.floor(Math.random() * charactersLength));
      }
      return result;
    },
    async downloadImage() {
      // 提取Base64字符串中的编码后的数据（跳过MIME类型部分）
      const base64Data = this.currentBase64.split(',')[1];

      // 将Base64编码的数据转换为ArrayBuffer
      const binaryString = atob(base64Data);
      const len = binaryString.length;
      const bytes = new Uint8Array(len);
      for (let i = 0; i < len; i++) {
        bytes[i] = binaryString.charCodeAt(i);
      }
      // 创建一个Blob对象
      const blob = new Blob([bytes], { type: 'image/png' });
      // 创建一个指向Blob对象的URL
      const url = URL.createObjectURL(blob);
      // 生成随机字符串作为文件名
      const randomFileName = this.generateRandomString(10) + '.png'; // 你可以调整生成字符串的长度
      // 创建一个临时的<a>标签
      const link = document.createElement('a');
      // 设置<a>标签的href属性为Blob URL
      link.href = url;
      // 设置下载的文件名
      link.download = randomFileName;
      // 将<a>标签添加到文档中（不需要添加到DOM中，只需要为了触发点击事件）
      document.body.appendChild(link);
      // 触发点击事件以下载文件
      link.click();
      // 从文档中移除<a>标签
      document.body.removeChild(link);
      // 释放Blob URL
      URL.revokeObjectURL(url);
    },
    depCover(file) {
      if (file.type.indexOf("image/") == -1) {
        this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
      } else {
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => {
          this.form.coverImg = reader.result;
          this.inputFile('dep')
        };
      }
    },
    positionCover(file) {
      if (file.type.indexOf("image/") == -1) {
        this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
      } else {
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => {
          this.form.distributeImg = reader.result;
          this.inputFile('postion')
        };
      }
    },
    // 上传图片
    uploadImg() {
      this.$refs.cropper.getCropBlob(data => {
        let formData = new FormData();
        formData.append("avatarfile", data);
        uploadAvatar(formData).then(response => {
          this.open = false;
          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
          store.commit('SET_AVATAR', this.options.img);
          this.$modal.msgSuccess("修改成功");
          this.visible = false;
        });
      });
    },
    requestUpload() { },
    async inputFile(type) { //上传图片
      //form.distributeImg = fileRes.content
      //form.coverImg = backRes.content
      if (type == 'dep') {
        let res = await hospInfoPut({ 'coverImg': this.form.coverImg })
        if (res.code == 200) {
          this.$modal.msgSuccess("保存成功")
        } else {
          console.log(res.msg)
          this.$modal.msgError("保存失败，请稍后尝试")
        }
      } else if (type == 'postion') {
        let res = await hospInfoPut({ 'deptdistribute': this.form.distributeImg })
        if (res.code == 200) {
          this.$modal.msgSuccess("保存成功")
        } else {
          console.log(res.msg)
          this.$modal.msgError("保存失败，请稍后尝试")
        }
      }
      // let res = await hospInfoPut({ 'coverImg': this.form.coverImg })
    },
    /** 查询运营科室管理列表 */
    getList() {
      this.loading = true;
      listDept(this.queryParams).then(response => {
        this.deptList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    async getHosList() {  // 获取医院列表
      let res = await hosList()
      let data = res.data
      data.forEach(v => {
        this.options.push({
          value: v.hospital_code,
          label: v.hospital_name
        })
      })
      // console.log(res);
    },
    TitleSelect() { //切换医院
      this.resetQuery()
      if (this.queryParams.hospCode !== null) {
        this.getTitleList(this.queryParams.hospCode)
        this.queryParams.templateId = null
      }
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        hospitalCode: null,
        operateDeptName: null,
        deptCode: null,
        startTime: null,
        endTime: null,
        detail: null,
        advantage: null,
        assistantName: null,
        assistantPhone: null,
        deptNo: null,
        remark: null,
        goodAt: null,
        status: null,
        createTime: null,
        updateTime: null,
        attacheServiceTime: null,
        zlRange: null,
        tsSkill: null,
        ysmajor: null,
        coverImg: null,
        deptdistribute: null,
        distributeImg: null,
        keyDept: null,
        attacheName: null,
        attachePhone: null,
        assistantDept: null,
        assistantPost: null,
        illnessLabel: null,
        hospitalName: null,
        deptUrlCode: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      if(this.deptList && this.deptList.length > 0){
          this.form.hospitalCode = this.deptList[0].hospitalCode
        }
      this.open = true;
      this.title = "添加科室管理";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getDept(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改科室管理";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateDept(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDept(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除运营科室管理编号为"' + ids + '"的数据项？').then(function () {
        return delDept(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('hcem/dept/export', {
        ...this.queryParams
      }, `dept_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style scoped lang="scss">
.section {
  font-size: 1.3em;
  font-weight: 600;
  padding-left: 10px;
  padding-bottom: 25px;
  position: relative;

  &:before {
    content: "";
    width: 6px;
    background-color: #409EFF;
    height: 20px;
    position: absolute;
    left: 0;
    top: 3px;
  }
}

.dialog-footer {
  text-align: center;
  padding-bottom: 40px;
}

.dialog-img {
  text-align: center;
  padding-bottom: 20px;
}
</style>
<!-- <style>
.el-table__fixed {
    height: auto !important;
    bottom: 17px !important;
}

</style> -->
